<template>
  <div class="repair">
    <FormPanel ref="formPanel" :list="orderInformationList" :cols="4" :isSubmitBtn="false" />
    <div>
      <LazyLoadTab v-model="activeName" :tabMenus="menus"></LazyLoadTab>
    </div>
  </div>
</template>
<script>
import { searchVehicle } from '@/api/customerRepair/activityVisit/resultEntry';
export default {
  props: ['getdata'],
  data() {
    return {
      propsdata: this.getdata,
      orderInformationList: this.createOrderTable(),
      datalist: {},
      activeName: '本地维修历史',
      menus: [
        {
          title: '本地维修历史',
          path: 'repair/business/customer/Repairhistory/repairhistoryTable',
          params: {
            setdata: this.getdata
          },
          on: {
            close: this.cancel
          }
        },
        {
          title: '本地维修项目',
          path: 'repair/business/customer/Repairhistory/repairProjectTable',
          params: {
            setdata: this.getdata
          },
          on: {
            close: this.cancel
          }
        },
        {
          title: '本地维修备件',
          path: 'repair/business/customer/Repairhistory/repairParts',
          params: {
            setdata: this.getdata
          },
          on: {
            close: this.cancel
          }
        },
        {
          title: 'OEM维修历史',
          path: 'repair/business/customer/Repairhistory/OEMtable',
          params: {
            setdata: this.getdata
          },
          on: {
            close: this.cancel
          }
        },
        {
          title: '三包历史查询',
          path: 'repair/business/customer/Repairhistory/SBaotable',
          params: {
            setdata: this.getdata
          },
          on: {
            close: this.cancel
          }
        }
      ]
    };
  },
  // created() {
  //   this.searchVvehicle();
  // },
  methods: {
    createOrderTable() {
      return [
        {
          type: 'INPUT',
          label: 'VIN',
          fieldName: 'vin',
          initialValue: this.getdata['VIN'],
          rules: [{ required: true, message: '请输入VIN...', trigger: 'change' }],
          change: val => {
            this.getdata['VIN'] = val;
          }
        }
      ];
    },
    cancel() {
      this.$emit('close', false);
    }
    // async searchVvehicle() {
    //   const res = await searchVehicle();
    //   this.datalist = res.data.rows[0];
    //   this.formList.find(item => item.fieldName === 'lossLimit').initialValue = this.datalist.OWNER_NAME;
    //   this.formList.find(item => item.fieldName === 'maxLimit').initialValue = this.datalist.maxLimit;
    //   this.formList.find(item => item.fieldName === 'minLimit').initialValue = this.datalist.minLimit;
    //   this.formList.find(item => item.fieldName === 'warningId').initialValue = this.datalist.ENGINE_NO;
    // }
  }
};
</script>
<style scoped>
.text {
  font-size: 14px;
}

.item {
  margin-bottom: 18px;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: '';
}
.clearfix:after {
  clear: both;
}

.usertop {
  margin-bottom: 10px;
}
.grid-content {
  position: relative;
  top: -6px;
}
</style>
